package com.hspedu.newData.dmsxl.数组;

import java.util.Arrays;

/**
 * @Author: yh
 * @description: 
 * @CreateTime: 2025-05-13 
 * @Version: 1.0
 */

public class LC628三个数的最大乘积 {

    public int maximumProduct(int[] nums) {
        Arrays.sort(nums);
        int len = nums.length - 1;
        return Math.max(nums[0]*nums[1]*nums[len],nums[len]*nums[len-1]*nums[len-2]);
    }
}
